<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="header.jsp"%>
	<style>
	.addAccount .form_block {
	    width: 100%;
	}
	.addAccount .form_block .from_group label {
	    width: 36%;
	    padding-right: 120px;
	}
	.addAccount .form_block .from_group .form_control {
   		width: 35%;
	}
	</style>
		
	    <div class="flex-container">
			  <%@ include file="leftmenu.jsp"%>
			<div class="right-container right_container_content" style="overflow-y: scroll;">
			    <div class="right_content right_content_main" style="height:auto;">
			    	<div class="header header_line">
			    		<h6>添加载体上报</h6>
			    	</div>
			    	<div class="addAccount">
			    	    <div class="form_block">
			    	    	<form id="add_form">
			    	    		<div class="from_group">
			    	    			<label>月份</label>
			    	    			<div class="input-append date form_date" data-date="" data-date-format="yyyy-mm" data-link-format="yyyy-mm">
			    	    			<input class="form_control" name="month" type="text" readonly="readonly" value="${carrierReport.month }" />
							      	<span class="add-on"><i class="icon-th"></i></span>
							      	</div>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>载体名称</label>
			    	    			<select class="form_control" name="carrierid" id="carrier_select" onchange="selectCarrier();">
			    	    			<option value="">请选择</option>
			    	    			<c:forEach items="${carrierList }" var="c">
			    	    				<option <c:if test="${carrierReport.carrierid eq c.id }">selected="selected"</c:if> value="${c.id }">${c.name }</option>
			    	    			</c:forEach>
			    	    			</select>
			    	    			<input class="form_control" name="carrierName" id="carrierName" value="" type="text" style="display: none;"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>地址</label>
			    	    			<input class="form_control" name="address" type="text" value="${carrierReport.address }" />
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>状态</label>
			    	    			<select class="form_control" name="status">
			    	    			<option <c:if test="${carrierReport.status eq '已建' }">selected="selected"</c:if> value="已建">已建</option>
			    	    			<option <c:if test="${carrierReport.status eq '在建' }">selected="selected"</c:if> value="在建">在建</option>
			    	    			<option <c:if test="${carrierReport.status eq '拟建' }">selected="selected"</c:if> value="拟建">拟建</option>
			    	    			</select>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>运营单位</label>
			    	    			<input class="form_control" name="organization" type="text" value="${carrierReport.organization }"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>负责人</label>
			    	    			<input class="form_control" name="master" type="text" value="${carrierReport.master }"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>联系方式</label>
			    	    			<input class="form_control" name="contact" type="text" value="${carrierReport.contact }"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>总面积</label>
			    	    			<input class="form_control " name="acreage" value="${carrierReport.acreage }" id="acreage" type="number" step="0.01" onblur="checkFloatNumber('acreage', '总面积')" />
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>企业或团队数量</label>
			    	    			<input class="form_control" name="teamNumber" value="${carrierReport.teamNumber }" id="teamNumber" type="number" step="1" onblur="checkIntNumber('teamNumber', '企业或团队数量')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>企业或团队总人数</label>
			    	    			<input class="form_control" name="teamEmployees" value="${carrierReport.teamEmployees }" id="teamEmployees" type="number" step="1" onblur="checkIntNumber('teamEmployees', '企业或团队总人数')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>企业或团队已使用面积</label>
			    	    			<input class="form_control" name="teamAcreage" value="${carrierReport.teamAcreage }" id="teamAcreage" type="number" step="0.01" onblur="checkFloatNumber('teamAcreage', '企业或团队已使用面积')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>未入驻面积</label>
			    	    			<input class="form_control" name="acreageNotAdmitted" value="${carrierReport.acreageNotAdmitted }" id="acreageNotAdmitted" type="number" step="0.01" onblur="checkFloatNumber('acreageNotAdmitted', '未入驻面积')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>主要产业</label>
			    	    			<input class="form_control" name="majorIndustries" value="${carrierReport.majorIndustries }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>建设内容</label>
			    	    			<input class="form_control" name="constructionContent" value="${carrierReport.constructionContent }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>完成时间</label>
			    	    			<div class="input-append date form_datetime" data-date="" data-date-format="yyyy-mm-dd" data-link-format="yyyy-mm-dd">
			    	    			<input class="form_control" name="completeTime" type="text" readonly="readonly" value="${carrierReport.completeTime }" />
							      	<span class="add-on"><i class="icon-th"></i></span>
							      	</div>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>投资额</label>
			    	    			<input class="form_control" name="investmentAmount" value="${carrierReport.investmentAmount }" id="investmentAmount" type="number" step="0.01" onblur="checkFloatNumber('investmentAmount', '投资额')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月增加面积</label>
			    	    			<input class="form_control" name="acreageMonthIncreased" value="${carrierReport.acreageMonthIncreased }" id="acreageMonthIncreased" type="number" step="0.01" onblur="checkFloatNumber('acreageMonthIncreased', '本月增加面积')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月增加企业</label>
			    	    			<input class="form_control" name="companyMonthIncreased" value="${carrierReport.companyMonthIncreased }" id="companyMonthIncreased" type="number" step="1" onblur="checkIntNumber('companyMonthIncreased', '本月增加企业')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>运营人员数量</label>
			    	    			<input class="form_control" name="operatorNumber" value="${carrierReport.operatorNumber }" id="operatorNumber" type="number" step="1" onblur="checkIntNumber('operatorNumber', '运营人员数量')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>兼职创业导师数量</label>
			    	    			<input class="form_control" name="partTimeMentorNumber" value="${carrierReport.partTimeMentorNumber }" id="partTimeMentorNumber" type="number" step="1" onblur="checkIntNumber('partTimeMentorNumber', '兼职创业导师数量')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>创业投资基金额度</label>
			    	    			<input class="form_control" name="investmentFund" value="${carrierReport.investmentFund }" id="investmentFund" type="number" step="0.01" onblur="checkFloatNumber('investmentFund', '创业投资基金额度')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月新增企业团队数量</label>
			    	    			<input class="form_control" name="companyMonthIncubated" value="${carrierReport.companyMonthIncubated }" id="companyMonthIncubated" type="number" step="1" onblur="checkIntNumber('companyMonthIncreased', '本月新增企业团队数量')"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月在孵团队注册为企业数量</label>
			    	    			<input class="form_control" name="teamRegisteredCompany" value="${carrierReport.teamRegisteredCompany }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月毕业企业数量</label>
			    	    			<input class="form_control" name="teamMonthGraduated" value="${carrierReport.teamMonthGraduated }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>上市挂牌企业数量</label>
			    	    			<input class="form_control" name="listedCompanyNumber" value="${carrierReport.listedCompanyNumber }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>吸纳就业总人数</label>
			    	    			<input class="form_control" name="bringEmploymentNumber" value="${carrierReport.bringEmploymentNumber }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月企业团队专利申请量</label>
			    	    			<input class="form_control" name="patentMonthApplication" value="${carrierReport.patentMonthApplication }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月企业团队专利授权量</label>
			    	    			<input class="form_control" name="patentMonthAuthorized" value="${carrierReport.patentMonthAuthorized }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>发明专利申请量</label>
			    	    			<input class="form_control" name="inventionPatentMonthApplication" value="${carrierReport.inventionPatentMonthApplication }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>发明专利授权量</label>
			    	    			<input class="form_control" name="inventionPatentMonthAuthorized" value="${carrierReport.inventionPatentMonthAuthorized }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>实用新型专利申请量</label>
			    	    			<input class="form_control" name="utilityPatentMonthApplication" value="${carrierReport.utilityPatentMonthApplication }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>实用新型专利授权量</label>
			    	    			<input class="form_control" name="utilityPatentMonthAuthorized" value="${carrierReport.utilityPatentMonthAuthorized }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>外观设计专利申请量</label>
			    	    			<input class="form_control" name="designPatentMonthApplication" value="${carrierReport.designPatentMonthApplication }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>外观设计专利授权量</label>
			    	    			<input class="form_control" name="designPatentMonthAuthorized" value="${carrierReport.designPatentMonthAuthorized }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月入孵企业、团队融资额</label>
			    	    			<input class="form_control" name="teamFinancing" value="${carrierReport.teamFinancing }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月创新创业活动开展次数</label>
			    	    			<input class="form_control" name="innovationActivityCount" value="${carrierReport.innovationActivityCount }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月创新创业教育类活动开展次数</label>
			    	    			<input class="form_control" name="innovationEducationalActivityCount" value="${carrierReport.innovationEducationalActivityCount }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月创业国际交流活动开展次数</label>
			    	    			<input class="form_control" name="internationalActivitiesCount" value="${carrierReport.internationalActivitiesCount }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月总收入</label>
			    	    			<input class="form_control" name="income" value="${carrierReport.income }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>本月总支出</label>
			    	    			<input class="form_control" name="expenditure" value="${carrierReport.expenditure }" type="text"/>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>是否国家级众创空间（孵化器）</label>
			    	    			<%-- <input class="form_control" name="isNationalMakerspace" value="${carrierReport.isNationalMakerspace }" type="text"/> --%>
			    	    			<select class="form_control" name="isNationalMakerspace">
			    	    			<option <c:if test="${carrierReport.isNationalMakerspace }">selected="selected"</c:if> value="1">是</option>
			    	    			<option <c:if test="${not carrierReport.isNationalMakerspace }">selected="selected"</c:if> value="0">否</option>
			    	    			</select>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>是否省级众创空间（孵化器）</label>
			    	    			<%-- <input class="form_control" name="isProvincialMakerspace" value="${carrierReport.isProvincialMakerspace }" type="text"/> --%>
			    	    			<select class="form_control" name="isProvincialMakerspace">
			    	    			<option <c:if test="${carrierReport.isProvincialMakerspace }">selected="selected"</c:if> value="1">是</option>
			    	    			<option <c:if test="${not carrierReport.isProvincialMakerspace }">selected="selected"</c:if> value="0">否</option>
			    	    			</select>
			    	    		</div>
			    	    		<div class="from_group">
			    	    			<label>是否区县开发区级众创空间（孵化器）</label>
			    	    			<%-- <input class="form_control" name="isCountyMakerspace" value="${carrierReport.isCountyMakerspace }" type="text"/> --%>
			    	    			<select class="form_control" name="isCountyMakerspace">
			    	    			<option <c:if test="${carrierReport.isCountyMakerspace }">selected="selected"</c:if> value="1">是</option>
			    	    			<option <c:if test="${not carrierReport.isCountyMakerspace }">selected="selected"</c:if> value="0">否</option>
			    	    			</select>
			    	    		</div>
			    	    		<div class="from_group" style="margin-bottom: 150px;">
			    	    			<label>&nbsp;&nbsp;&nbsp;</label>
			    	    			<a class="form_btn" id="form_submit">提交</a>
			    	    		</div>
			    	    		
			    	    	</form>
			    	    </div>
			        </div>
			    </div>
			   
			</div>
		</div>
	<script>
		
		
		$("#form_submit").click(function() {
			$.ajax({  
			    type: "POST",  
			    url:"<%=path%>/admin/reportSave",  
			    data:$('#add_form').serialize(),  
			    async: false,  
			    error: function(request) {  
			        alert("系统异常！");  
			    },  
			    success: function(data) {  
			        //接收后台返回的结果  
			    	alert('增加成功！');
					window.location.href="<%=path %>/admin/report"; 
			    }  
			  });
		});
		
		function checkFloatNumber(id, field){
			var sid = "#" + id;
			var val = $(sid).val();
			var r = /^\d+(\.\d{0,2})?$|^\.\d{1,2}$/.test(val);
			if(!r){
				alert(field + "格式不正确，请重新输入！");
				return;
			}
		}
		
		function checkIntNumber(id, field){
			var sid = "#" + id;
			var val = $(sid).val();
			var r = /^([1-9]\d*|[0]{1,1})$/.test(val);
			if(!r){
				alert(field + "格式不正确，请重新输入！");
				return;
			}
		}
		
		function  selectCarrier() {
			var selectText=$("#carrier_select").find("option:selected").text();
			$("#carrierName").attr("value", selectText)
		}
		
		$(".form_date").datetimepicker({
			format:'yyyy-mm', 
	        language:  'zh-CN',
	        weekStart: 1,
	        todayBtn:  1,
			autoclose: 1,
			todayHighlight: 1,
			startView: 3,
			minView: 3,
			forceParse: 0
		    });
		
		$(".form_datetime").datetimepicker({
			format:'yyyy-mm-dd', 
	        language:  'zh-CN',
	        weekStart: 1,
	        todayBtn:  1,
			autoclose: 1,
			todayHighlight: 1,
			startView: 2,
			minView: 2,
			forceParse: 0
		    });
		
	</script>
